package wu.com;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;

public class regServlet extends HttpServlet {
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        String name=request.getParameter("name");
        String password=request.getParameter("password");
        String sex =request.getParameter("sex");
        String phone = request.getParameter("phone");
        String email=request.getParameter("email");
        Yonghuzhuce yonghuzhuce = new Yonghuzhuce();
        boolean a=yonghuzhuce.login(name,password,sex,phone,email);
        if (a){
            PrintWriter out = response.getWriter();
            out.println("注册成功");
        }
        else{
            PrintWriter out = response.getWriter();
            out.println("注册失败");
        }
    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

    }
}
